from typing import Optional

from sqlalchemy import BigInteger, DateTime, Integer, PrimaryKeyConstraint, String, func
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
import datetime

from config.database import Base
from utils.uuid import UUID


class Resource(Base):
    __tablename__ = 'resource'

    owner: Mapped[int] = mapped_column(String(100), primary_key=True)
    name: Mapped[str] = mapped_column(String(180), primary_key=True)
    created_time: Mapped[str] = mapped_column(String(100))
    user: Mapped[str] = mapped_column(String(100))
    provider: Mapped[str] = mapped_column(String(100))
    application: Mapped[str] = mapped_column(String(100))
    tag: Mapped[str] = mapped_column(String(100))
    parent: Mapped[str] = mapped_column(String(100))
    file_name: Mapped[str] = mapped_column(String(255))
    file_type: Mapped[str] = mapped_column(String(100))
    file_format: Mapped[str] = mapped_column(String(100))
    file_size: Mapped[int] = mapped_column(BigInteger)
    url: Mapped[str] = mapped_column(String(255))
    description: Mapped[str] = mapped_column(String(255))
